#include<bits/stdc++.h>
using namespace std;
const int N=100;
int n,m,castle,mount,swamp,cnt;
char mp[N][N];
queue<pair<int,int> >q;
bool vis[N][N];
bool cut(){
	memset(vis,false,sizeof(vis));
	int x,y,v=0;bool flag=false;
	for(int i=1;i<=n;++i){
		for(int j=1;j<=m;++j)
			if(mp[i][j]=='0'){
				q.push(make_pair(i,j));
				flag=true;
				break;
			}
		if(flag) break;
	}
	while(!q.empty()){
		x=q.front().first;y=q.front().second;q.pop();
		if(mp[x][y]=='1') continue;
		if(vis[x][y]) continue;
		++v;vis[x][y]=true;
		if(x>1) q.push(make_pair(x-1,y));
		if(x<n) q.push(make_pair(x+1,y));
		if(y>1) q.push(make_pair(x,y-1));
		if(y<m) q.push(make_pair(x,y+1));
	}
//	cout<<"!"<<v<<" "<<cnt<<endl;
	return v!=m*n-cnt-1;
}
bool insert(int x,int y){
	mp[x][y]='1';
	if(cut()){
		mp[x][y]='0';
		return false;
	}
	return true;
}
int main(){
	freopen("g.in","r",stdin);
	freopen("g.out","w",stdout);
	srand(time(0));
	memset(mp,'0',sizeof(mp));
	cin>>n>>m>>mount>>castle>>swamp;
	//cout<<n<<'\n'<<m<<'\n';
	int x,y;
	while(cnt<mount){
		x=rand()%n+1;y=rand()%m+1;
		if(mp[x][y]!='0') continue;
		if(insert(x,y)) ++cnt;
	}
	cnt=0;
	while(cnt<castle){
		x=rand()%n+1;y=rand()%m+1;
		if(mp[x][y]!='0') continue;
		mp[x][y]='2'; ++cnt;
	}
	cnt=0;
	while(cnt<swamp){
		x=rand()%n+1;y=rand()%m+1;
		if(mp[x][y]!='0') continue;
		mp[x][y]='4'; ++cnt;
	}
	for(int i=1;i<=n;++i){
		for(int j=1;j<=m;++j)
			cout<<mp[i][j]<<' ';
		cout<<'\n';
	}
	fclose(stdin);fclose(stdout);
	return 0;
}
